package com.hw.one.transpot.fileupload.constant;

import com.hw.one.collect.config.ConditionConfig;
import com.hw.one.transpot.constant.TransportDataConstant;
import com.hw.one.transpot.entity.TransportConstant;
import com.hw.one.transpot.fileupload.util.UploadUtil;

/**
 * @Class Constant
 * @Author guoshenzhen
 * @Date 2018/4/1  21:36
 */
public class Constant {
    /**
     * 分片大小
     */
    public static final int SUB_SIZE;
    public static final String IP;
    public static final int PORT;
    public static final String APPID = TransportDataConstant.APPID;
    public static final String APPKEY= TransportDataConstant.APPKEY;

    static {
        String transferFileIP = ConditionConfig.get("transferFileIP", ConditionConfig.fileUpload);
        IP = null == transferFileIP ? "127.0.0.1" : transferFileIP;
        String transferFilePort = ConditionConfig.get("transferFilePort", ConditionConfig.fileUpload);
        PORT = null == transferFilePort ? 0 : Integer.parseInt(transferFilePort);
        String subSize = ConditionConfig.get("subSize", ConditionConfig.fileUpload);
        SUB_SIZE = null == subSize ? 1024 * 128 : Integer.parseInt(subSize);
        String transferConfPath = ConditionConfig.get("transferConfPath", ConditionConfig.fileUpload);
        CONF_SAVE_PATH = null == transferConfPath ? "D:\\client\\tempdir" : transferConfPath;
        TEMP_SAVE_PATH = null == transferConfPath ? "D:\\client\\tempdir" : transferConfPath;
    }



    /**
     * 配置文件保存路径
     */
    public static final String CONF_SAVE_PATH;
    /**
     * 上传文件路径
     */
    public static final String  UPLOAD_FILE_PATH = UploadUtil.getSaveFileName();
//    public static final String  UPLOAD_FILE_PATH = "I:\\mybatis.log";

    /**
     *  临时文件保存路径
     */
    public static final String  TEMP_SAVE_PATH;
}
